@import '@/styles/color.less';
@import '@/styles/token.less';
// 运行结果组件样式
.runResultContainer {
  width: 100%;
  max-width: 300px;
  min-width: 220px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  background-color: #fff;
  overflow: hidden;
  margin-top: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 6%);
}

// 头部样式
.runResultHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  // border-bottom: 1px solid #f0f0f0;
  // background-color: #fafafa;
}

.runResultStatus {
  display: flex;
  align-items: center;
}

.statusIcon {
  font-size: 20px;
  margin-right: 8px;

  &.success {
    color: #52c41a;
  }

  &.error {
    color: #ff4d4f;
  }
}

.statusText {
  font-size: 14px;
  font-weight: @fontWeightStrong;
}

.runTime {
  font-size: 12px;
  color: rgb(0, 178, 60);
  background: rgba(105, 209, 140, 30%);
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 6px;
}

.collapseIcon {
  cursor: pointer;
  font-size: 14px;
  color: #8c8c8c;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;

  &:hover {
    background-color: #f0f0f0;
  }
}

// 内容样式
.runResultBody {
  padding: 0 6px 6px;
  max-height: 300px;
  overflow-y: auto;
}

// 总数和分页
.runResultInfo {
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.totalCount {
  font-size: 12px;
  margin-right: 8px;
  flex: 1;
}

.runResultPagination {
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.runResultPaginationPages {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: space-between;
}

.runResultPageItem {
  width: 22px;
  height: 22px;
  font-size: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  &:hover {
    background-color: #f0f0f0;
    color: #412bff;
  }

  &.active {
    background-color: #f0f0f0;
    color: #412bff;
  }
}

.runResultPageSelect {
  width: 60px;
  margin-left: 12px;
}

.selectArrow {
  font-size: 12px;
  color: #8c8c8c;
}

.onlyErrorCheckbox {
  margin-left: auto;

  :global {
    .ant-checkbox-inner {
      width: 14px;
      height: 14px;
    }

    .ant-checkbox-label {
      font-size: 12px;
    }
  }
}

// 批处理变量
.runResultBatch {
  margin-bottom: 10px;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
}

.runResultBatchHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 12px;
  background-color: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-weight: @fontWeightStrong;
}

.runResultBatchContent {
  padding: 6px 8px;
  background-color: #fff;
}

// 输入输出部分
.runResultSection {
  font-size: 12px;
  margin-top: 12px;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.runResultSectionHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background-color: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-weight: @fontWeightStrong;
}

.runResultSectionContent {
  background-color: @BLANK12;
  // 横向滚动条样式
  &::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }

  overflow-x: auto;
  width: 100%;
  max-height: 200px;
  padding: 6px 8px;

  code {
    margin: 0;
    font-size: 10px;
    line-height: 1.3;
    font-family: Courier, 'Courier New', 'Fira Mono', Consolas, Menlo, Monaco,
      monospace;
    white-space: pre-wrap;
    word-break: break-word;
  }
}

.keyValueItem {
  display: flex;
  margin-bottom: 4px;
  font-size: 12px;
  word-break: break-all;

  &:last-child {
    margin-bottom: 0;
  }
}

.key {
  color: #6366f1;
  margin-right: 4px;
  font-weight: @fontWeightStrong;
}

.value {
  color: #333;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runResultPageSelectRoot {
  width: 60px;

  :global {
    .ant-select-selector {
      font-size: 12px !important;
    }
  }
}
